<template>
  <div class='mypop'>
      <backHeader title="我的推广"></backHeader>
      <p class="center-mine-promotion-title">当前已成功推荐0人，复制链接给朋友一起赢大奖</p>
      <div class="center-mine-promotion-wrap">
          <p class="center-mine-promotion-url" id='text'>https://gy0008z.com/?r=z939#reg</p>
          <div class="center-mine-promotion-btn" @click='copyBtn'>点击复制</div>
      </div>
  </div>
</template>

<script>
import backHeader from '../../components/backHeader'
export default {
    components:{
        backHeader
    },
    methods:{
        copyBtn(){
             var textArea = document.createElement("textarea");
             textArea.value = 'https://gy0008z.com/?r=z939#reg';
             document.body.appendChild(textArea);
             textArea.select();
             document.execCommand('copy');
            this.$toast.success('复制成功');
            document.body.removeChild(textArea);
        },
    }
}
</script>

<style long='less' scoped>
.center-mine-promotion-title {
    padding-left: 10px;
    line-height: 40px;
    font-size: 14px;
    color: #666;
}
.center-mine-promotion-wrap {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-direction: column;
    flex-direction: column;
    margin: 0 10px;
    padding: 8px 5px;
    background-color: #fff;
}
.center-mine-promotion-url {
    margin-bottom: 10px;
    font-size: 14px;
}
.center-mine-promotion-btn {
    -ms-flex-item-align: end;
    align-self: flex-end;
    background-color: transparent;
    font-size: 14px;
    color: #661dac;
}
</style>